import pandas as pd
from pandas import DataFrame

#指定输出格式，否则会报错
import sys
import os
import io
sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='utf_8_sig') 

datafile = './文本/客运量_1-1.csv' 
datafile2 = './文本/货运量_1-1.csv'

data = pd.DataFrame(pd.read_csv(datafile))
data2 = pd.DataFrame(pd.read_csv(datafile2))

#查找A,B,C三组机场的区别

#客运量
#A组和B组
print(set((data[data['Year'] == 2010]['Airport name'].tolist())).difference(set((data[data['Year'] == 2007]['Airport name'].tolist()))))
#B组和C组
print(set((data[data['Year'] == 2018]['Airport name'].tolist())).difference(set((data[data['Year'] == 2010]['Airport name'].tolist()))))
#A组和C组
print(set((data[data['Year'] == 2018]['Airport name'].tolist())).difference(set((data[data['Year'] == 2007]['Airport name'].tolist()))))

print("-------------------------")

#货运量
#A组和B组
print(set((data2[data2['Year'] == 2010]['Airport name'].tolist())).difference(set((data2[data2['Year'] == 2007]['Airport name'].tolist()))))
#B组和C组
print(set((data2[data2['Year'] == 2018]['Airport name'].tolist())).difference(set((data2[data2['Year'] == 2010]['Airport name'].tolist()))))
#A组和C组
print(set((data2[data2['Year'] == 2018]['Airport name'].tolist())).difference(set((data2[data2['Year'] == 2007]['Airport name'].tolist()))))